package com.yuq.sunrise.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.yuq.sunrise.mapper.IUserMapper;
import com.yuq.sunrise.model.User;
import com.yuq.sunrise.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;

/**
 * @author ：yuq
 * @date ：Created in 2019/6/9 0:28
 * @description：用户信息
 * @modified By：
 * @version: 1.0$
 */
//@Component    //注入到容器
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private IUserMapper userMapper;

    @Override
    public Integer save(User user) {
        return userMapper.insert(user);
    }

    @Override
    public Integer delete(User user) {
        return userMapper.delete(user);
    }

    @Override
    public Integer deleteByPrimaryKey(Object o) {
        return userMapper.deleteByPrimaryKey(o);
    }

    @Override
    public Integer updateByPrimaryKey(User user) {
        return userMapper.updateByPrimaryKey(user);
    }

    @Override
    public User queryOne(User user) {
        return userMapper.selectOne(user);
    }

    @Override
    public User queryByPrimaryKey(Object o) {
        return userMapper.selectByPrimaryKey(o);
    }

    @Override
    public List<User> queryList(User user) {
        return userMapper.select(user);
    }

    @Override
    public User queryOneByPrimaryKey(Object o) {
        return userMapper.selectByPrimaryKey(o);
    }

    @Override
    public List<User> queryListByObject(Object o) {
        return userMapper.selectByExample(o);
    }

    @Override
    public List<User> queryAll() {
        return userMapper.selectAll();
    }

    /****************************************** 以上为service原始方法，无需变动 *****************************************/

    @Override
    public List<User> queryAllByLimit(Map<String, Object> params) {
        return userMapper.queryAllByLimit(params);
    }

}
